package licode.unisop.realm.domainx.dp;

import org.springframework.util.Assert;

public class NickName {
    public static final NickName EMPTY = new NickName("");
    private final String nickName;

    public NickName(String nickName) {
        Assert.notNull(nickName, "别名为空：" + nickName);
        Assert.isTrue(nickName.length() < 20,
                "别名太长（小于20字符）：" + nickName);
        this.nickName = nickName;
    }

    public String getNickName() {
        return nickName;
    }

    public boolean equals(NickName Other) {
        return this.nickName.equals(Other.getNickName());
    }
}
